package com.killer.listener;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.killer.pojo.Order;
import com.killer.service.OrderService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "order_check",consumerGroup = "g3")
public class OrderCheckListener implements RocketMQListener<Long> {

    @Autowired
    private OrderService orderService;

    @Override
    public void onMessage(Long orderId) {
        orderService.deleteDueOrder(orderId);
    }
}
